<?php
	if(isset($_GET['uid'])&&intval($_GET['uid'])>0)
	{
		$uid=intval($_GET['uid']);
	}
	else
	{
		if($logid!=false)
			$uid=$logid;
		else
			edp_redirect(edp_href_link(PAGENAME_PAGE_NOT_FOUND));
	}
?>   
   <div class="main_box">
        	<div class="left_bar">
            	<div class="left_topbg"></div>
                <div class="left_border">
                	<dl class="member_head_box">
                    	<dt><img src="<?php echo EdpGetAvatarUrl( $user['logo_path'] );?>" width="80" height="80" /></dt>
                        <dd>
                        	<div class="member_name"><a href="<?php echo edp_href_link(PAGENAME_USER_INFO, 'uid='.$user['id']);?>"><?php secho( $user['nick'] ); ?></a></div>
                        	<div class="degree_box">                          	
     
                                <span class="<? echo getUserRankClass($user['contribution']); ?>"></span>
                        	</div>
                            <div class="member_degree">贡献度: <span style="color:red; font-weight: bold;"><?php echo $user['contribution'];?></span></div>
                            <div class="member_degree">E币: <span style="color:red; font-weight: bold;"><?php echo $user['coins'];?></span></div>
                        </dd>
                    </dl>

                    
                    <ul class="member_login_info">
                    	<li>所在城市：
                    	<?php 
                    		if($cityDAO->GetCityName($user['location'])==false)
                    			echo '保密';
                    		else
                    			echo $cityDAO->GetCityName($user['location']);
                    	?></li>
                        <li>注册时间：<?php echo EdpSubStr($user['register_date'], 0, 10);?></li>
                        <li>上次登录：<?php echo EdpSubStr($user['last_login'], 0, 10);?></li>
                    </ul>
                    
                     <?php if(edp_is_empty_string($user['logo_path'])){ ?>                  
                   		 <p style="float: left; margin-left: 13px; font-weight:bold;"><a href="<?php echo edp_href_link(PAGENAME_USER_SETTING, "subpage=change_avatar")?>"><font color="red">提示：上传头像获得10点E币</font></a><p>
					<?php } ?>
                     
          <?php 
                  if($logid&&$logid!=$uid)
                  { 
?>  
                    <ul class="member_addfriend">
                    	<li><a name="<?php echo $user['id'].'_'.$user['nick'];?>" class="add_friend" href="#">加为好友</a></li>
                        <li><a name="<?php echo $user['id'].'_'.$user['nick'];?>" class="send_msg" href="#">发信</a></li>
                    </ul>
<?php 
                  } 
?> 
                    <dl class="dl_list">
                    	<dt>个人简介</dt>
                        <dd>
                        	<div class="summary_txt">
                        		<?php 
                        			if(edp_is_empty_string($user['introduction']))
                        				echo '无个人简介';
                        			else
                        				secho( $user['introduction'] ); 
                        		?>
                        	</div>
                        	<dl class="ul_list">
                            	<li>性别：<?php echo $userDetailInfo['sex'] == 0 ? "男" : "女";?></li>
                            	<?php
                            		echo '<li>生日：';
                            		if($userDetailInfo['birthday']!='0000-00-00 00:00:00') 
                            		{
                            			echo EdpSubStr($userDetailInfo['birthday'],0,10);
                            		}
                            		else
                            		{
                            			echo '保密';
                            		}
                            		echo '</li><li>行业/职业：';
                            		if(!edp_is_empty_string($userDetailInfo['profession']))
                            		{
                            			secho( EdpGetProfessional( $userDetailInfo['profession'] ) );
                            		}
                            		else
                            		{
                            			echo '保密';
                            		}
                            		echo '</li><li>学历：';
                            		if(!edp_is_empty_string($userDetailInfo['education']))
                            		{
                            			secho( EdpGetEducationLevel( $userDetailInfo['education'] ) );
                            		}
                            		else
                            		{
                            			echo '保密';
                            		}
                            		echo '</li><li>月收入：';
                            		if(!edp_is_empty_string($userDetailInfo['salary']))
                            		{
                            			secho( EdpGetRevenue( $userDetailInfo['salary'] ) );		
                            		}
                            		else
                            		{
                            			echo '保密';
                            		}
                            		echo '</li>';
                                    /* 等做了privacy control以后再显示
									if($userDetailInfo['qq_display']=='1')
										echo '<li>QQ：'.$userDetailInfo['qq'].'</li>';
				                 	/*
									if($userDetailInfo['msn_display']=='1') 
										echo '<li>MSN：'.$userDetailInfo['msn'].'</li>';
										*/
                            		if(!edp_is_empty_string($userDetailInfo['shopping_method']))
                            		{
                            			echo '<li>购物渠道：';
                            			$shopping_method=explode(' ', trim($userDetailInfo['shopping_method']));
                            		?>
                            			<a href="<?php echo edp_href_link(PAGENAME_SHOP_SEARCH_RESULT, 'q='.sconv($shopping_method[0]));?>" target="_blank"><?php secho($shopping_method[0]);?></a>
                            		<?php
                            			for($i=1; $i<count($shopping_method); $i++)
                            			{
                            				if(strlen($shopping_method[$i])!=0)
                            				{
                            		?>
                            				 • <a href="<?php echo edp_href_link(PAGENAME_SHOP_SEARCH_RESULT, 'q='.sconv($shopping_method[$i]));?>" target="_blank"><?php secho($shopping_method[$i]);?></a>
                            		<?php
                            				}
                            			}
                            			echo '</li>';
                            		}
                            		if(!edp_is_empty_string($userDetailInfo['shopping_plat']))
                            		{
                            			echo '<li>购物平台：';
	                            		$shopping_plat=explode(' ', trim($userDetailInfo['shopping_plat']));
	                            		?>
	                            			<a href="<?php echo edp_href_link(PAGENAME_SHOP_SEARCH_RESULT, 'q='.sconv($shopping_plat[0]));?>" target="_blank"><?php secho($shopping_plat[0]);?></a>
	                            		<?php
	                            			for($i=1; $i<count($shopping_plat); $i++)
	                            			{
	                            				if(strlen($shopping_plat[$i])!=0)
	                            				{
	                            		?>
	                            				 • <a href="<?php echo edp_href_link(PAGENAME_SHOP_SEARCH_RESULT, 'q='.sconv($shopping_plat[$i]));?>" target="_blank"><?php secho($shopping_plat[$i]);?></a>
	                            		<?php
	                            				}
	                            			}
                            			echo '</li>';
                            		}
                            		if(!edp_is_empty_string($userDetailInfo['interested_cate']))
                            		{
                            			echo '<li>感兴趣的商品：';
	                            		$interested_cate=explode(' ', trim($userDetailInfo['interested_cate']));
		                            	?>
		                            		<a href="<?php echo edp_href_link(PAGENAME_SHOP_SEARCH_RESULT, 'q='.sconv($interested_cate[0]));?>" target="_blank"><?php secho($interested_cate[0]);?></a>
		                            	<?php
		                            		for($i=1; $i<count($interested_cate); $i++)
		                            		{
		                            			if(strlen($interested_cate[$i])!=0)
		                            			{
		                            	?>
		                            			 • <a href="<?php echo edp_href_link(PAGENAME_SHOP_SEARCH_RESULT, 'q='.sconv($interested_cate[$i]));?>" target="_blank"><?php secho($interested_cate[$i]);?></a>
		                            	<?php
		                            			}
		                            		}
                            			echo '</li>';
                            		}
                            		if(!edp_is_empty_string($userDetailInfo['interested_grand']))
                            		{
                            			echo '<li>感兴趣的品牌：';
                            			$interested_grand=explode(' ', trim($userDetailInfo['interested_grand']));
		                            	?>
		                            		<a href="<?php echo edp_href_link(PAGENAME_SHOP_SEARCH_RESULT, 'q='.sconv($interested_grand[0]));?>" target="_blank"><?php secho($interested_grand[0]);?></a>
		                            	<?php
		                            		for($i=1; $i<count($interested_grand); $i++)
		                            		{
		                            			if(strlen($interested_grand[$i])!=0)
		                            			{
		                            	?>
		                            			 • <a href="<?php echo edp_href_link(PAGENAME_SHOP_SEARCH_RESULT, 'q='.sconv($interested_grand[$i]));?>" target="_blank"><?php secho($interested_grand[$i]);?></a>
		                            	<?php
		                            			}
		                            		}
                            			echo '</li>';
                            		}
								?>                                                      								
                            </ul>
                        </dd>
                    </dl>
                    
                 <?php if(($userDetailInfo['profession']==='')&&
					($userDetailInfo['education']==='')&&
					($userDetailInfo['salary']==='')){ ?> 
                    <p style="float: left; margin-left: 13px; font-weight:bold;"><a href="<?php echo edp_href_link(PAGENAME_USER_SETTING,'subpage=detail_info')?>"><font color="red">提示：完善信息获得40点E币</font></a><p>
				<?php } ?>
                    
                    <dl class="dl_list">
                    	<dt>资料统计</dt>
                        <dd>
                        	<ul class="ul_list">
                            	<li>添加点评：<?php echo $userStatistic['review_count'];?></li>
                                <li>添加店铺：<?php echo $userStatistic['add_shop_count'];?></li>
                                <li>添加商品：<?php echo $userStatistic['add_product_count'];?></li>
                                <li>添加评单：<?php echo $userStatistic['list_count'];?></li>
                                <li>修正店铺：<?php echo $userStatistic['modify_shop_count'];?></li>
                                <li>修正商品：<?php echo $userStatistic['modify_product_count'];?></li>
                                <li>收获鲜花：<?php echo $userStatistic['flower_count'];?></li>
                            </ul>
                        </dd>
                    </dl>
                    <dl class="dl_list">
                    	<dt>访客记录</dt>
                        <dd>
                        	<ul class="ul_list_pic">
                        	
                        	<?php	
                  			if($visitUserList)
                  			{
								foreach($visitUserList as $visitUser)
								{
									$visitor=$userDAO->GetUserByID($visitUser);
							?>
                            	<li>
                                	<div>
                                	<a href="<?php echo edp_href_link(PAGENAME_USER_INFO,'uid='.$visitor['id']);?>">
                                		<img src="<?php echo EdpGetAvatarUrl($visitor['logo_path']);?>" width="40" height="40" />
                                	</a>
                                	</div>
                                    <span><a href="<?php echo edp_href_link(PAGENAME_USER_INFO,'uid='.$visitor['id']);?>"><?php secho( $visitor['nick'] ); ?></a></span>.
                                </li>  
							<?php
								} 
                  			}
      
							?>
                            
                            </ul>
                        </dd>
                    </dl>
                </div>
                <div class="left_bottombg">访问人气：<?php echo $user['view_count'];?></div>
            </div>
            
            
      <!-- Start of center -->      
            
            <div class="center_bar"> 
            
          <!-- Start of latest review -->     
            
            	<div class="new_title">最新的点评</div>
             <?php 
             	if(count($reviewList)>'0')
             	{
            	 foreach( $reviewList as $review ) {
              ?>
                <div class="new_box">
                	<div class="new_top"></div>
                    <div class="new_body">
                    	<div class="new_body_title">
                    		<a href="<?php echo edp_href_link(PAGENAME_SHOP_INFO, 'sid='.$review['shop_id']);?>">
                    			<?php secho( $review['shop_name'] ); ?>
                    		</a>
                    	</div>
                    	<div class="comment_1">
                            <div class="smallpoint_box">
                                <div class="smallscore<? echo $review['score']+1;?>"></div>    
                            </div>
                                                            
                            <h2>宝贝真实度</h2><h3><?php echo $review['reality']; ?></h3>
                            <h2>服务态度</h2><h3><?php echo $review['service']; ?></h3>
                            <h2>发货速度</h2><h3><?php echo $review['velocity']; ?></h3>
                            <h2>性价比</h2><h3><?php echo $review['rate']; ?></h3>
                        </div>
                       
                        <?php if($review['product_list']){?>                        	
	                    	<dl class="new_goods">
	                        	<dt>商品：</dt>
	                            <dd>                                
                                <?php foreach ($review['product_list'] as $product_info) {?>
									<span><a href="<?php echo edp_href_link(PAGENAME_PRODUCT_INFO, 'pid='.$product_info['id']);?>"><?php secho( $product_info['product_name'] ); ?> </a></span>
								<?php }?>									
							   </dd>
                            </dl>	                        
                        <?php }?>                        
                        

                    	<div class="new_txt">
                    	   <?php 
                    	   if(EdpStrLen($review['content'])>200)
                    	   {
                    	   		secho(EdpSubStr($review['content'],0,200).'...');
                    	   }
                    	   else
                    	   {
                    	   		secho($review['content']);
                    	   }
                    	   ?>
                           <a href="<?php echo edp_href_link(PAGENAME_REVIEW_INFO,'rid='.$review['review_id']); ?>">详情>></a>
                        </div>

        			   <?php if($review['tags']){?>                    
	                        <dl class="new_label">
	                        	<dt>标签：</dt>
	                            <dd>                       
                                <?php foreach ($review['tags'] as $tag) {?>
								<a href="<?php echo edp_href_link(PAGENAME_SHOP_SEARCH_RESULT,'q='.$tag); ?>"><?php secho( $tag ); ?></a>
								<?php }?>
								</dd>
                            </dl>
                       <?php }?>
                            
  						<?php if($review['pic_list']){?>                           
	                        <dl class="new_pic">
	                        	<dt>图片：</dt>
	                            <dd>                                
                            	<?php foreach ($review['pic_list'] as $pic_info) {?>
								<span><a href="<?php echo EdpGetPicURL($pic_info['picture_path']); ?>"><?php echo $pic_info['name']; ?></a></span>
							    <?php } ?>
								</dd>							
                            </dl>
	                    <?php }?> 
	                        
                         <div class="new_edit">
                            	<h1>
                            	<span>发表于 <?php echoPageVar($review, 'review_date'); ?></span>
                            	<?php if($logid!=$uid) {?>
                            	<a href="<?php echo edp_href_link(PAGENAME_REVIEW_INFO,'rid='.$review['review_id'].'#reponse_anchor');?>">回应</a><?php if(intval($review['response_count'])>0) echo '<span>('.$review['response_count'].')</span>'; ?>
                            	<a id="Flower<?php echo $review['review_id'];?>" onclick="popupFlowerWindow('review','<?php echo $review['review_id']; ?>')"  href="#">鲜花</a><?php if(intval($review['flower_count'])>0) echo '<span id="Flower'.$review['review_id'].'" >('.$review['flower_count'].')</span>'; ?>
                            	<a id="Egg<?php echo $review['review_id'];?>" onclick="popupEggWindow('review','<?php echo $review['review_id']; ?>')"  href="#">鸡蛋</a><?php if(intval($review['egg_count'])>0) echo '<span id="Egg'.$review['review_id'].'" >('.$review['egg_count'].')</span>'; ?>
                            	<?php } ?>	      
                            	</h1>
                            	 <a href="<?php echo edp_href_link( PAGENAME_SHOP_INFO, "sid=".$review['shop_id']."#ar" );?>"><img src="<?php echo IMAGE_DIR; ?>btn_add_review2.jpg" /></a>
                            	
                            	<?php if($logid && $logid==$uid) {?>
                            	<h2>
                            		<a href="<?php echo edp_href_link(PAGENAME_ADD_REVIEW,'sid='.$review['shop_id'].'&rid='.$review['review_id']); ?>">修改评论</a>
                            		<a href="#" tag="delete" rid="<?php echo $review['review_id']; ?>">删除评论</a>
                            	</h2>
                            	<?php } ?>	     
                            	                                          
                       </div>  
                                              
                    </div>
                    <div class="new_bottom"></div>
                </div>
              <?php 
					}
             	}
              ?>     
                            
          <!-- End of latest review -->       
                
            	<div class="center_middle_box">
                
                	<div class="middle_box">
                    	<h1></h1>
                      <?php if($listList ){ ?>
                        <dl class="middle_list">
                        	<dt>添加的评单</dt>   
                        	<?php foreach($listList as $list){ ?>                    	
                          	  <dd><a href="<?php echo edp_href_link(PAGENAME_LIST_INFO,'lid='.$list['id']);?>"><?php secho( $list['title'] ); ?></a></dd>
							<?php } ?>
                        </dl>
                        <h3><a href="<?php echo edp_href_link(PAGENAME_USER_LIST,'uid='.$uid);?>">更多</a></h3>
                       <?php } else{ ?> 
                         <dl class="middle_list">
                          <dt>添加的评单</dt>    
                         </dl> 
                       <?php } ?> 
                        <h2></h2>
                    </div>
                    
                    
                    <div class="middle_box">
                    	<h1></h1>
                      <?php if($collectshopList ){ ?>         
                                 	
                        <dl class="middle_list">
                        	<dt>收藏的店铺</dt>
						    <?php foreach($collectshopList as $shop){?>                       	
                           	 	<dd>
                           	 	   <div>
                           	 		 <a href="<?php echo edp_href_link(PAGENAME_SHOP_INFO,'sid='.$shop['id']);?>">
                           	 		 	<img src="<?php secho( $shop['logo_url'] );?>" width="24" height="24" />
                           	 		 </a>
                           	 	   </div>
                           	 	   <span>
                           	 	     <a href="<?php echo edp_href_link(PAGENAME_SHOP_INFO,'sid='.$shop['id']);?>">
                           	 	     	<?php secho( $shop['shop_name'] ); ?>
                           	 	     </a>
                           	 	   </span>
                           	 	</dd>
                            <?php } ?>                       
                        </dl>
                        <h3><a href="<?php echo edp_href_link(PAGENAME_USER_COLLECTION,'uid='.$uid);?>">更多</a></h3>
                        <?php } else{ ?> 
                         <dl class="middle_list">
                        	<dt>收藏的店铺</dt>  
                         </dl>                         	                     
                        <?php } ?>                                               
                        <h2></h2>                                            
                    </div>
                </div>
                
                <div class="center_middle_box">
                
                	<div class="middle_box">
                    	<h1></h1>
                    	
                      <?php if($addshopList ){ ?>                                                   
                        <dl class="middle_list_bottom">
                        	<dt>添加的店铺</dt>
                            <dd>
                            	<ul class="middle_list_txt">
							    	<?php foreach($addshopList as $shop){?>                               	
	                            		<li>
	                                    	<div><a href="<?php echo edp_href_link(PAGENAME_SHOP_INFO,'sid='.$shop['id']);?>"><img src="<?php secho($shop['logo_url']);?>" width="40" height="40" /></a></div>
	                                    	<span><a href="<?php echo edp_href_link(PAGENAME_SHOP_INFO,'sid='.$shop['id']);?>"><?php secho( $shop['shop_name'] ); ?></a></span>
	                                        <span><?php echo EdpSubStr($shop['created'],0,10); ?></span>
	                                    </li>
	                      	        <?php } ?>   
                                </ul>  	                                    
                            </dd>                         
                        </dl>
                       <!--   <h3><a href="#">更多</a></h3>-->
                        <?php } else{ ?>
                         <dl class="middle_list_bottom">
                        	<dt>添加的店铺</dt>     
                         </dl>	                      
                        <?php } ?>                                                 
                        <h2></h2>
                    </div>
                    
                    <div class="middle_box">
                    	<h1></h1>
                    	
                      <?php if($addproductList ){ ?>                           	
                        <dl class="middle_list_bottom">
                        	<dt>添加的商品</dt>
                            <dd>
                            	<ul class="middle_list_pic">
							    	<?php foreach($addproductList as $product){?>                                       	
	                                	<li>
	                                        <div><a href="<?php echo edp_href_link(PAGENAME_PRODUCT_INFO,'pid='.$product['id']);?>"><img src="<?php secho($product['pic_path']); ?>" width="40" height="40" /></a></div>
	                                        <span><a href="<?php echo edp_href_link(PAGENAME_PRODUCT_INFO,'pid='.$product['id']);?>"><?php secho( $product['product_name'] ); ?></a></span>
	                                    </li>
	                      	        <?php } ?>
	                      	     </ul>                                
                            </dd>                            
                        </dl>
                       <!--   <h3><a href="#">更多</a></h3>-->
                        <?php } else{ ?>
                        <dl class="middle_list_bottom">
                        	<dt>添加的商品</dt>
                        </dl>	                        
                        <?php } ?>                            
                        <h2></h2>
                    </div>
                </div>
            </div>
            
            
            
            
            <div class="right_bar">
 				<?php  
 				
 				if(isset($eventStr))
 				{
 					echo '<dl class="news_active"><dt>最新动态</dt>';  
 					
 					$printN=0;
					for($num=0; $num<count($eventStr); $num++)
					{ 
						if(isset($eventStr[$num]['html'])&&!edp_is_empty_string($eventStr[$num]['html']))
						{			
							if($printN==5)
							{
								echo '</dl><dl class="news_active"  id="hiddenEvent10">';
							}
							if($printN==10) 
							{
								echo '</dl><dl class="news_active" id="hiddenEvent20">';
							}
				?>		
					 	 <dd><?php echo( $eventStr[$num]['html'] ); ?><span><?php echo( $eventStr[$num]['timediff'] ); ?></span></dd>	
					  			                
                <?php 
                			$printN++;
						}
						if($printN==20)
							break;
					 }
					
					echo '</dl>';
 				 }
                ?>

                
                <div class="show_number_box">
                	<div class="show_txt">显示最近</div>
                    <div class="show_current" id="five_event" >5</div>
                    <div class="show_no_current" id="ten_event" >10</div>
                    <div class="show_no_current" id="twenty_event" >20</div>
                    <div class="show_txt">条动态</div>
                </div>
            </div>

			<div id="PopBox" style="display:none;cursor:default;" class="popup"></div>

<div id=flowerAndEggBox style="display:none;cursor:default;" class="popup"></div>        


            



